package com.yuyou.tas.lesson.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.yuyou.tas.service.api.lesson.entity.LessonClassStudent;
import com.yuyou.tas.service.api.lesson.entity.Student;

@Mapper
public interface LessonClassStudentMapper {
	/**
	 * 根据班级主键和状态删除数据
	 * @param classId
	 * @param regStatus
	 * @return
	 */
    int deleteByClassId7regStatus(
    		@Param(value="lessonClassId")Long lessonClassId,
    		@Param(value="regStatus")Integer regStatus,
    		@Param(value="authOrganizationId") Long authOrganizationId);
    
    int deleteByPrimaryKey(Long id);

    int insert(LessonClassStudent record);

    LessonClassStudent selectByPrimaryKey(Long id);

    /**
     * studentId查找
     * @param studentId
     * @return
     */
    List<LessonClassStudent> findByStudentId(Long studentId);
    
    /**
     * studentOId查找
     * @param studentId
     * @return
     */
    List<LessonClassStudent> findByStudentOId(Long studentOId);
    
    int updateByPrimaryKeySelective(LessonClassStudent record);
    
    LessonClassStudent selectByOrgan7OId(@Param(value="lessonClassOId") Long lessonClassOId,
    		@Param(value="studentOId") Long studentOId,
    		@Param(value="authOrganizationId") Long authOrganizationId);
    
    void sycnStudent(
    		@Param(value="studentId") Long studentId,
    		@Param(value="studentOId") Long studentOId,
    		@Param(value="authOrganizationId") Long authOrganizationId);
    
    void sycnClass(
    		@Param(value="lessonClassId") Long lessonClassId,
    		@Param(value="lessonClassOId") Long lessonClassOId,
    		@Param(value="authOrganizationId") Long authOrganizationId);

    Integer getStudentCountByClassId(@Param(value = "classId") Long classId);
    
    Student selectUniStudent(
    		@Param(value = "authOrganizationId") Long authOrganizationId,
    		@Param(value = "lessonClassId") Long lessonClassId,
    		@Param(value = "lessonClassOId") Long lessonClassOId,
    		@Param(value = "studentId") Long studentId,
    		@Param(value = "studentOId") Long studentOId
    		);
    
}